package com.uzai.console.web.tb.tbstoreblacklist;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSort;
import com.uzai.console.annotation.SystemLogType;
import com.uzai.console.dto.tb.tbstoreblacklist.TbStoreBlacklistConfigDto;
import com.uzai.console.enums.OperationTypeEnum;
import com.uzai.console.enums.SystemModelEnum;
import com.uzai.console.service.tb.tbstoreblacklist.TbStoreBlacklistConfigService;
import com.uzai.console.vo.tb.tbstoreblacklist.TbStoreBlacklistConfigVo;
import com.uzai.console.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * 淘宝店铺黑名单基础设置
 * @author liuqi
 * @date 2021年08月16日 15:11
 */
@Api(value = "店铺黑名单基础设置",tags = "淘宝|店铺黑名单|基础设置")
@ApiSort(9)
@RestController
public class TbStoreBlacklistConfigController extends BaseController {
    private Logger logger = LoggerFactory.getLogger(TbStoreBlacklistConfigController.class);

    @Autowired
    private TbStoreBlacklistConfigService tbStoreBlacklistConfigService;

    @ApiOperation(value = "查询基础设置", notes = "查询基础设置", response = TbStoreBlacklistConfigVo.class)
    @ApiOperationSupport(order = 1)
    @PostMapping("/tbStoreBlacklistConfig/findTbStoreBlacklistConfig")
    public Object findTbStoreBlacklistConfig(){
        return tbStoreBlacklistConfigService.findTbStoreBlacklistConfig(getLoginInfo().getMerId());
    }

    @SystemLogType(model = SystemModelEnum.TbStoreBlacklist, type = OperationTypeEnum.UPDATE)
    @ApiOperation(value = "编辑基础设置", notes = "编辑基础设置" )
    @ApiOperationSupport(order = 2)
    @PostMapping("/tbStoreBlacklistConfig/updateTbStoreBlacklistConfig")
    public Object updateTbStoreBlacklistConfig(@RequestBody TbStoreBlacklistConfigDto tbStoreBlacklistConfigDto){
        tbStoreBlacklistConfigService.updateTbStoreBlacklistConfig(getLoginInfo().getMerId(), tbStoreBlacklistConfigDto);
        return true;
    }


}
